/*
 * DNSService.h
 *
 *  Created on: Dec 12, 2013
 *      Author: m
 */

#ifndef AGENT_ADDRESS_SERVICE_H_
#define AGENT_ADDRESS_SERVICE_H_

#include "agent_address_service.h"

namespace channel{

class AgentAddressService
{
protected:
    static const char* getServerAddress();

    static CLIENT* createClient();

public:

    typedef enum{STATIC_AGENT=0,DYNAMIC_AGENT}AgentType;

    static void create();

    static void destroy();

    static int getAddress();

    static int resolve( std::string name );

    static std::string resolveNameById(int agentName);

    static int registerNameStatic( std::string name, int address=0 );

    /* Alias of registerNameStatic to maintain compatibility */
    static int registerName( std::string name, int address=0 );

    static int registerNameDynamic( std::string name, int address=0 );

    static int registerQueueAgent( std::string queuePath,char key, int mType, int address=0 );

    static int resolveQueueAgent( std::string queuePath,char key, int mType);


    static void unregister( std::string name );
};

}//end namespace channel
#endif /* AGENT_ADDRESS_SERVICE_H_ */
